package com.migu.jdbc

import java.sql.{Connection, DriverManager}

/**
  * Created by maguoyun on 2017/03/22.
  */
object JdbcUtil {

  Class.forName("com.mysql.jdbc.Driver").newInstance()  //load driver   ，实例化

  def getConn(): Connection = {
    var con: Connection = null
    try {
      con = DriverManager.getConnection(
        "jdbc:mysql://192.168.107.88:3306/bigdata",
        "root",
        "123456")

    } catch {
      case e: Exception => println()
    }
    con
  }
}
